// The entry file of your WebAssembly module.
export function add(a: i32, b: i32): i32 {
    return a + b;
}

/** Calculates the n-th Fibonacci number. */
export function fib(n: i32): i32 {
    let a = 0, b = 1
    if (n > 0) {
        while (--n) {
            let t = a + b
            a = b
            b = t
        }
        return b
    }
    return a
}
